package cn.minhx.lab.design_patterns.factory_method.f2.prize;

import cn.minhx.lab.design_patterns.factory_method.f2.enums.PrizeTypeEnum;
import cn.minhx.lab.design_patterns.factory_method.f2.prize.impl.CardPrizeService;
import cn.minhx.lab.design_patterns.factory_method.f2.prize.impl.CouponPrizeService;
import cn.minhx.lab.design_patterns.factory_method.f2.prize.impl.GoodsPrizeService;

/**
 * @author merrick.peng
 */
public class PrizeFactory {

    private static final IPrizeService cardPrizeService = new CardPrizeService();
    private static final IPrizeService couponPrizeService = new CouponPrizeService();
    private static final IPrizeService goodsPrizeService = new GoodsPrizeService();

    public static IPrizeService getPrizeServer(PrizeTypeEnum prizeType) {
        return switch (prizeType) {
            case CARD -> cardPrizeService;
            case COUPON -> couponPrizeService;
            case GOODS -> goodsPrizeService;
        };
    }

}
